package com.zuijin.demo.interceptor;

import com.mybatisflex.spring.boot.ConfigurationCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MybatisConfig {
    @Bean
    public ConfigurationCustomizer mybatisConfigurationCustomizer() {
        return configuration -> {
            // 创建并添加拦截器实例到配置中
            configuration.addInterceptor(new MyExecutorInterceptor());
            configuration.addInterceptor(new MyStatementHandlerInterceptor());
            configuration.addInterceptor(new MyResultHandlerInterceptor());
            configuration.addInterceptor(new MyParameterHandlerInterceptor());
        };
    }
}